package Hbase;


import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.util.Bytes;
import pojo.ST;


public class AlterStudnet {
    public void alter(ST list1) throws IOException {
        Configuration conf = HBaseConfiguration.create();
        conf.set("hbase.zookeeper.quorum", "192.168.111.11");

        HTable table=new HTable(conf,"student");
        List<ST> list=new ArrayList<>();
        String id=list1.getStudentID();
        String status=list1.getStudentStatus();
        System.out.println(status);
        Put put1 = new Put(Bytes.toBytes(id));
        put1.add(Bytes.toBytes("status"), Bytes.toBytes("StudentStatus"), Bytes.toBytes(status));
        table.put(put1);
        System.out.println("更新成功");

    }
}
